from urllib import parse


url = 'https://www.baidu.com/s?{}'

params = {
    'wd':'搜狗拼音',
    'ie':'UTF-8'
}

result = parse.urlencode(params)

url = url.format(result)
print(url)